<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    function arr(n) {
      const MAX = 1e9
      let current = String(n).split('').sort().join('')
      let x = 1
      while (x <= MAX) {
        let now = String(x).split('').sort().join('')
        if (now === current) return true
        x <<= 1
      }
      return false
    };
    console.log(arr(1));
  </script>
</body>

</html>